QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Alpha Compositor

kAlphaCompositorTransitionType ('blnd')

This effect is used to combine two images using the alpha channels of the images to control the blending. It provides for the standard alpha blending options, and can handle pre-multiplying by any color, although white and black are most common and often run faster.

The alpha compositor effect takes a maximum of two sources and has two parameters.

Parameters

Use the descriptions below to help you understand what the parameters do. To learn how to use parameter atoms, see "Adding Video Effects to a QuickTime Movie"

Name

Code

QTAtom Type

Description

Blend mode

'bMod'

kParameterTypeDataEnum

Contains the blend mode for the effect.

Pre-multiply color

'mclr'

kParameterTypeDataRGBValue

If the blend mode is "pre-multiply alpha," this parameter contains the color used in the pre-multiply blend, otherwise it is ignored.

Blend Mode Enum

The blend mode parameter can contain one of the following values:

  1. Straight alpha - perform a standard alpha blend. The alpha channel value of the first source defines the amount of the first source that is included in the composited image, and one minus the alpha channel value of the first source defines the amount of the second source that is included in the composited image.
  2. Pre-multiply alpha - calculates the destination pixel according to the following formulae:
    DestinationRed = PreMultiplyRed * (1-alphaC) + temp1 * alphaC
    DestinationGreen = PreMultiplyGreen * (1-alphaC) + temp2 * alphaC
    DestinationBlue = PreMultiplyBlue * (1-alphaC) + temp3 * alphaC

where:

    alphaC = alphaB + (1-alphaB) * alphaA
    temp1 = (alphaA * SourceARed + alphaB * sourceBRed)/alphaC
    temp2 = (alphaA * SourceAGreen + alphaB * sourceBGreen)/alphaC
    temp3 = (alphaA * SourceABlue + alphaB * sourceBBlue)/alphaC
  1. Reverse alpha - perform a reverse alpha blend. The one minus the alpha channel value of the first source defines the amount of the first source that is included in the composited image, and the alpha channel value of the first source defines the amount of the second source that is included in the composited image.

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |